package com.orange.quickback.demo;

import com.orange.quickback.system.api.common.result.QBootResult;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "QBootTable")
@RestController
@RequestMapping("/QBootTable/")
public class QBootTableController {
    @Resource
    QBootTableServiceImpl qBootTableService;
    @GetMapping("/getAllQBootTables")
    public QBootResult getAllQBootTables() {
        return qBootTableService.getAllQBootTables();
    }
    @PostMapping("/getQBootTablesById")
    public QBootResult getQBootTablesById(@RequestParam String id){
        return qBootTableService.getQBootTablesById(Long.valueOf(id));
    }
    @PostMapping("/saveQBootTable")
    public QBootResult saveQBootTable(@RequestBody QBootTable qBootTable){
        return qBootTableService.saveQBootTable(qBootTable);
    }
    @PostMapping("/saveQBootTables")
    public QBootResult saveQBootTables(@RequestBody List<QBootTable> qBootTables){
        return qBootTableService.saveQBootTables(qBootTables);
    }
    @PostMapping("/getQBootTablesByPage")
    public QBootResult getQBootTablesByPage(@RequestParam int page, @RequestParam int size){
        return qBootTableService.getQBootTablesByPage(page,size);
    }
    @PostMapping("/getQBootTablesByPageDesc")
    public QBootResult getQBootTablesByPageDesc(@RequestParam  int page,@RequestParam int size){
        return qBootTableService.getQBootTablesByPageDesc(page,size);
    }
    @PostMapping("/deleteQBootTablesById")
    public QBootResult deleteQBootTablesById(@RequestParam String id){
        return qBootTableService.deleteQBootTablesById(Long.valueOf(id));
    }
    @PostMapping("/deleteQBootTables")
    public QBootResult deleteQBootTables(@RequestBody QBootTable qBootTable){
        return qBootTableService.deleteQBootTables(qBootTable);
    }
}
